//
//  XSChartView.h
//  Test
//
//  Created by xueshan1 on 2018/12/13.
//  Copyright © 2018 xueshan1. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "XSChartViewModel.h"

/*
 1.该类 支持折线图 & 柱状图
 2.若需要自定制相应属性,需要在调用 - drawChartViewWithDataSource 方法之前设置
 
 */

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, XSChartViewType) {
    XSChartViewType_Line,
    XSChartViewType_Pillar,
};


@interface XSChartView : UIView

@property(nonatomic,assign)XSChartViewType chartType;
@property(nonatomic,assign)BOOL isShowGridding;
@property(nonatomic,assign)CGFloat topMargin;
@property(nonatomic,assign)CGFloat leftMargin;
@property(nonatomic,assign)CGFloat ydataMaxValue;//y最大值
@property(nonatomic,assign)CGFloat yAxisCount; //y间距个数
@property(nonatomic,assign)CGFloat axisWidth;
@property(nonatomic,assign)CGFloat axisFontSize;
@property(nonatomic,strong)UIColor *axisColor;
@property(nonatomic,strong)NSArray *xAxisTitles;//x坐标标题
@property(nonatomic,assign)CGFloat lineWidth;//折线
@property(nonatomic,assign)CGFloat pillarWidth;//柱宽度


- (void)drawChartViewWithDataSource:(NSArray<XSChartViewModel *>*)dataSource;

@end

NS_ASSUME_NONNULL_END
